Kameleon-Plus  0.3.2
MASInterpolator.h
Go to the documentation of this file.
1 /*
2  * MASInterpolator.h
3  *
4  * Created on: Jul 9, 2009
5  * Author: dberrios
6  */
7 
8 #ifndef MASINTERPOLATOR_H_
9 #define MASINTERPOLATOR_H_
10 
11 #include "Interpolator.h"
12 #include "Model.h"
13 
14 namespace ccmc
15 {
23  {
24  public:
25  MASInterpolator(Model * model);
26  float interpolate(const std::string& variable, const float& r, const float& lat, const float& lon);
27  float interpolate(const std::string& variable, const float& r, const float& lat, const float& lon, float& dr, float& dlat, float& dlon);
28  float interpolate(const long& variable_id, const float& r, const float& lat, const float& lon);
29  float interpolate(const long& variable_id, const float& r, const float& lat, const float& lon, float& dr, float& dlat, float& dlon);
30  virtual ~MASInterpolator();
31 
32  private:
33  //TODO: fix these coordinate names. phi should be longitude, theta should be latitude
34  std::string r_string;
35  std::string r1_string;
36  std::string lat_string;
37  std::string lon_string;
38  std::string lat1_string;
39  std::string lon1_string;
40  float previous_r;
41  float previous_lon;
42  float previous_lat;
43  int previous_ir;
44  int previous_ilon;
45  int previous_ilat;
46  std::string previous_r_grid_name;
47  std::string previous_lat_grid_name;
48  std::string previous_lon_grid_name;
49 
50  float interpolate_in_block_mas(
51  float r,
52  float lat,
53  float lon,
54  const std::vector<float>* r_data,
55  const std::vector<float>* lat_data,
56  const std::vector<float>* lon_data,
57  int nr,
58  int nlat,
59  int nlon,
60  int ir,
61  int ilat,
62  int ilon,
63  const long& variable_id,
64  float& dr,
65  float& dlat,
66  float& dlon);
67 
68  int index(const int& ir, const int& ilat, const int& ilon, const int& nlat, const int& nlon);
69 
70 
71 
72  };
73 }
74 #endif /* MASINTERPOLATOR_H_ */